<!-- 
 * 企业详情
 * @author: 
 * @since: 2022-05-18
 * index.vue
-->
<template>
    <div class="company-container">
        <div class="title">企业实名认证</div>
        <div class="companyInfo">
            <div class="one-part">
                <div class="item">
                    <div class="key">企业名称：</div>
                    <div class="value">{{ state.authentication.name }}</div>
            </div>
            <div class="item">
                <div class="key creditCode">统一社会信用代码：</div>
                    <div class="value">{{ state.authentication.card }}</div>
                </div>
                <!-- <div class="item">
              <div class="key">企业类型：</div>
              <div class="value">{{ state.authentication.companyType }}</div>
            </div> -->
            </div>
            <div class="businessLicense">
                <div>营业执照：</div>
                <div class="businessLicense-img">
                    <el-image style="width: 280px; height: 170px" :src="state.authentication.filePath" fit="cover" :preview-src-list="state.authentication.filePath" />
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
import { reactive, defineProps, onMounted, defineEmits } from 'vue';
import { getUserAuthenticationInfoApi } from '@/api/interface/registerUserManage.js'
const state = reactive({
    authentication: {}
})
const props = defineProps({
    userInfo: {
        type: Object,
        default: () => { }
    }
})
const emit = defineEmits(['backInfo'])

onMounted(() => {
    getUserAuthenticationInfo()
})

//获取用户认证信息
const getUserAuthenticationInfo = () => {
    const params = {
        userName: props.userInfo.userName
    }
    getUserAuthenticationInfoApi(params).then(res => {
        const { status, data } = res
        if (status === 200) {
            state.authentication = data[0]
            emit('backInfo', data[0])
        }
    })
}



</script>

<style lang="scss" scoped>
.company-container {
    .title {
        color: #333;
        font-weight: bold;
        font-size: 16px;
        margin-bottom: 40px;
    }

    .companyInfo {
        width: 100%;

        .item {
            display: flex;
            color: #333333;
            font-size: 14px;
            margin: 0 80px 30px 0;

            .value {
                font-weight: bold;
            }
        }

        .w20 {
            width: 20%;
        }
    }

    .businessLicense {
        &-img {
            margin-top: 10px;
        }
    }
}</style>
